
    var clock = '';
    var nums = 10;
    var btn;
    function sendCode(thisBtn){	
            btn = thisBtn;
            btn.disabled = true; //将按钮置为不可点击
            btn.innerHTML=nums+'秒后重新获取';
            clock = setInterval(doLoop, 1000); //一秒执行一次
        }
        function doLoop(){
            nums--;
            if(nums > 0){
              btn.innerHTML=nums+'秒后重新获取';
              btn.style.background="#4c6cc9";
              btn.style.color="#fff"
            }else{
                clearInterval(clock); //清除js定时器
                btn.disabled = false;
                btn.innerHTML='获取验证码';
                nums = 10; //重置时间
                btn.style.background="#fff";
                btn.style.color="#666"
        }
      }